import Vue from "vue"
import Toast from "./Toast"

let ToastConstructor = Vue.extend(Toast);

let instance;

const toast = function(options = {}) {
    instance = new ToastConstructor({
        data: options // 这里的 data 会传到 toast 组件中的data中去， 也可以写在props里面
    });
    document.body.appendChild(instance.$mount().$el);
}

Vue.prototype.$Toast = toast

export default toast;